//package cn.janescott.inner.space.shiro.boot;
//
//import org.apache.shiro.mgt.SecurityManager;
//import org.apache.shiro.realm.Realm;
//import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
//import org.apache.shiro.web.session.mgt.ServletContainerSessionManager;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.List;
//
///**
// * 此类用于web情况下的shiro自动配置
// *
// * @author scott
// * @date 2018/7/27
// */
//@Configuration
//@ConditionalOnBean({Realm.class})
//@ConditionalOnWebApplication
//public class ShiroSecurityManagerConfiguration {
//
//    private List<Realm> realms;
//
//    @Autowired(required = false)
//    public void setRealms(List<Realm> realms) {
//        this.realms = realms;
//    }
//
//    /**
//     * @return
//     * @see org.apache.shiro.spring.web.config.AbstractShiroWebConfiguration
//     */
//
//    @Bean
//    public SecurityManager securityManager() {
//        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
//        securityManager.setRealms(realms);
//        securityManager.setSessionManager(new ServletContainerSessionManager());
//        return securityManager;
//    }
//
//
//}
